package com.mz.mattress.client.timer;

import com.mz.mattress.api.event.MyEvent;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class MyAnnotationListener {

    @Async
    @EventListener
    public void onApplicationEvent(MyEvent event) {

        Thread thread = Thread.currentThread();

        System.out.println("MyAnnotationListener=" + thread.getName());

        Class<?> aClass = event.getSource().getClass();
        System.out.println(aClass);
        System.out.println("MyAnnotationListener_get_tag=" + event.getTag());
        System.out.println("MyAnnotationListener_get_message=" + event.getMessage());

    }
}
